#include <stdio.h>
#include <string.h>
#define MAX_N 1001
#define MAX_DEGREE 1000
int adj[MAX_N][MAX_DEGREE];
int degree[MAX_N];
int visited[MAX_N];

int main() {
    int N, M;
    while (1) {
        scanf("%d %d", &N, &M);
        if (N == 0) break;

        memset(degree, 0, sizeof(degree));

        for (int i = 0; i < M; i++) {
            int u, v;
            scanf("%d %d", &u, &v);
            adj[u][degree[u]++] = v;
            adj[v][degree[v]++] = u;
        }

        int all_even = 1;
        for (int i = 1; i <= N; i++) {
            if (degree[i] % 2 != 0) {
                all_even = 0;
                break;
            }
        }

        if (!all_even) {
            printf("NO\n");
            continue;
        }

        memset(visited, 0, sizeof(visited));
        int queue[MAX_N];
        int front = 0, rear = 0;

        visited[1] = 1;
        queue[rear++] = 1;

        while (front < rear) {
            int u = queue[front++];
            for (int i = 0; i < degree[u]; i++) {
                int v = adj[u][i];
                if (!visited[v]) {
                    visited[v] = 1;
                    queue[rear++] = v;
                }
            }
        }

        int connected = 1;
        for (int i = 1; i <= N; i++) {
            if (!visited[i]) {
                connected = 0;
                break;
            }
        }

        printf(connected ? "YES\n" : "NO\n");
    }

    return 0;
}
